package zasm.zasm.listing;

import java.util.Iterator;

public class FirstPassListingWriter extends AbstractListingWriter {

	private int	maxFileDepth	= 0;
	private int	maxLineNumber	= 0;

	public FirstPassListingWriter() {
		super();
	}

	public int getMaxFileDepth() {
		if (getFileDepth() > maxFileDepth) {
			maxFileDepth = getFileDepth();
		}
		return maxFileDepth;
	}

	public int getMaxLineNumber() {
		if (getLineNumber() > maxLineNumber) {
			maxLineNumber = getLineNumber();
		}
		return maxLineNumber;
	}

	@Override
	public void popFile() {
		getMaxFileDepth();
		getMaxLineNumber();
		super.popFile();
	}

	@Override
	protected void writeInternal(final Iterator<String> in, final byte[] out) {}

	@Override
	public void close() {
		if (getFileDepth() > 0) {
			popFile();
		}
	}

	@Override
	public void flush() {}

}
